package net.godcode.olivenotes.pages.blog.admin;

import java.util.ArrayList;
import java.util.List;

import net.godcode.olivenotes.entities.Post;
import net.godcode.olivenotes.entities.PostDAO;

import org.apache.tapestry.ioc.annotations.Inject;

/**
 * Posts
 * 
 * @author Chris Lewis 15/gen/08 <chris@thegodcode.net>
 * @version $Id: Posts.java 22 2008-01-19 09:17:14Z burningodzilla $
 */
public class Posts {
	
	@Inject
	private PostDAO postDao;
	
	private Post currentPost;
	
	private List<Post> posts = new ArrayList<Post>();
	
	void onActivate() {
		this.posts = postDao.findAll();
	}

	/**
	 * @return the posts
	 */
	public List<Post> getPosts() {
		return posts;
	}

	/**
	 * @return the currentPost
	 */
	public Post getCurrentPost() {
		return currentPost;
	}

	/**
	 * @param currentPost the currentPost to set
	 */
	public void setCurrentPost(Post currentPost) {
		this.currentPost = currentPost;
	}
	
}